
# include "dfxKeyboard.h"

namespace DFX
{
    bool Keyboard::KeyDown(KEYBOARD_KEY key)
    {
        return mKeyStates[key];
    }

    bool Keyboard::KeyHeld(KEYBOARD_KEY key)
    {
        return (mKeyStates[key] && mHoldStates[key]);
    }

    bool Keyboard::KeyTriggered(KEYBOARD_KEY key)
    {
        return (mKeyStates[key] && !mHoldStates[key]);
    }

    void Keyboard::Sleep()
    {
        mIsAwake = false;
        
        memset(mKeyStates, 0, sizeof(bool)* KEYBOARD_KEY_MAX);
        memset(mHoldStates, 0, sizeof(bool)* KEYBOARD_KEY_MAX);
    }

    void Keyboard::Awake()
    {
        mIsAwake = true;
    }
}